﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ZJK.Models.ExpertManage
{
    using NHibernate;
    using DB_NH.DB_Model.ZJK;
    using DB_NH;

    /// <summary>
    /// 专家预处理列表模型
    /// </summary>
    public partial class ExpertConfirm
    {
        /// <summary>
        /// 查询的项目ID
        /// </summary>
        public string Q_project_id { get; set; }

        /// <summary>
        /// 查询的项目名称
        /// </summary>
        public string Q_project_name { get; set; }

        /// <summary>
        /// 查询的专家姓名
        /// </summary>
        public string Q_name { get; set; }

        /// <summary>
        /// 查询的专家电话
        /// </summary>
        public string Q_phone { get; set; }

        /// <summary>
        /// 查询的专家专业
        /// </summary>
        public string Q_professional { get; set; }

        /// <summary>
        /// 查询的专家分类ID
        /// </summary>
        public string Q_category_id { get; set; }

        /// <summary>
        /// 查询的专家分类名称
        /// </summary>
        public string Q_category_name { get; set; }

        #region 定义操作类型及操作传递的ID信息
        /// <summary>
        /// 当前Model的操作类型
        /// </summary>
        public partial class OPType
        {
            /// <summary>
            /// 查询关联的项目信息列表
            /// </summary>
            public static readonly string QUERY_REF_PROJECT = "QueryRefProjects";

            /// <summary>
            /// 根据查询条件，查询专家列表
            /// </summary>
            public static readonly string QUERY_EXPERT_LIST = "QueryExpertList";

            /// <summary>
            /// 添加在当前专家列表中选定的专家信息到抽取记录信息列表中
            /// </summary>
            public static readonly string ADD_THIS_EXPERT = "AddThisExpert";

            /// <summary>
            /// 在当前专家抽取专家列表中删除指定的记录
            /// </summary>
            public static readonly string DELETE_THIS_EXTRACT = "DeleteThisExtract";

            /// <summary>
            /// 保存当前项目的抽取记录
            /// </summary>
            public static readonly string SAVE_THIS_PROJECT_EXTRACT = "SAVE";
        };

        /// <summary>
        /// 操作标志
        /// </summary>
        public string opFlag { get; set; }

        /// <summary>
        /// 添加当前专家操作的专家ID
        /// </summary>
        public string opThisExpertID { get; set; }

        /// <summary>
        /// 删除当前抽取记录ID
        /// </summary>
        public string opThisExtractID { get; set; }
        #endregion

        #region 定义专家备选记录的关联项目列表
        /// <summary>
        /// 专家备选记录的关联项目列表类
        /// </summary>
        [Serializable]
        public class RefProject
        {
            /// <summary>
            /// 项目ID
            /// </summary>
            public string projectID { get; set; }

            /// <summary>
            /// 项目编号
            /// </summary>
            public string projectCode { get; set; }

            /// <summary>
            /// 项目名称
            /// </summary>
            public string projectName { get; set; }

            /// <summary>
            /// 项目是否被选定
            /// </summary>
            public bool projectIsSelected { get; set; }
        }

        /// <summary>
        /// 定义备选抽取记录的项目关联记录
        /// </summary>
        public List<RefProject> thisExtractRefProjects { get; set; }
        #endregion

        #region 定义ViewModel用到的专家信息类
        /// <summary>
        /// 定义ViewModel用到的专家信息类
        /// </summary>
        [Serializable]
        public class ViewModelExpert
        {
            /// <summary>
            /// 专家ID
            /// </summary>
            public string expertID { get; set; }

            /// <summary>
            /// 专家姓名
            /// </summary>
            public string expertName { get; set; }

            /// <summary>
            /// 专家电话
            /// </summary>
            public string expertPhone { get; set; }

            /// <summary>
            /// 专家手机
            /// </summary>
            public string expertMobile { get; set; }

            /// <summary>
            /// 专家专业
            /// </summary>
            public string expertProfession { get; set; }

            /// <summary>
            /// 专家分类
            /// </summary>
            public string expertCategory { get; set; }
        }

        /// <summary>
        /// 根据专业、分类查询出来的备选专家列表，等待用户进行选择
        /// </summary>
        public List<ViewModelExpert> expertList_bx { get; set; }
        #endregion


        #region 定义ViewModel的专家抽取信息类
        /// <summary>
        /// ViewModel的专家抽取信息类，用于保持已经选择的专家，抽取是否成功，抽取过程提示等信息
        /// </summary>
        [Serializable]
        public class ViewModelExtract
        {
            /// <summary>
            /// ID
            /// </summary>
            public string ID { get; set; }

            /// <summary>
            /// 专家信息
            /// </summary>
            public ViewModelExpert expertInfo { get; set; }

            /// <summary>
            /// 专家抽取结果是否成功
            /// </summary>
            public int extractIsSucessed { get; set; }

            /// <summary>
            /// 专家抽取过程提示信息
            /// </summary>
            public string extractLog { get; set; }
        }
       

        /// <summary>
        /// 已选的专家抽取记录列表
        /// </summary>
        public List<ViewModelExtract> extractList { get; set; }
        #endregion

        public ExpertConfirm()
        {
            thisExtractRefProjects = new List<RefProject>();

            expertList_bx = new List<ViewModelExpert>();
            extractList = new List<ViewModelExtract>();
        }
    }


    /// <summary>
    /// 抽取备选记录的ViewModel
    /// </summary>
    public partial class vmBakForExtract
    {
        /// <summary>
        /// 用于保存抽取备选记录关联的项目IDs，以逗号分割
        /// </summary>
        public string bak_record_proj_ids { get; set; }

        /// <summary>
        /// 用于保存当前所要设置的抽取记录的ID
        /// </summary>
        public string bak_record_id { get; set; }

        /// <summary>
        /// 创建用户
        /// </summary>
        public string bak_record_user_name { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public string bak_record_date { get; set; }
    }
}